package fr.expdev.bndd.data;

import java.util.Date;

import fr.expdev.bndd.R;

public class Post {
	public String _title;
	private Date _publicationDate;
	private String _excerpt;
	private String _link;
	private int _type = -1;

	public static final int TYPE_LOADING = -1;
	public static final int TYPE_NOTHING = 0;
	public static final int TYPE_GWT = 1;
	public static final int TYPE_GENERAL = 2;
	public static final int TYPE_SMARTY = 3;

	public Post() {
		super();
	}
	
	public Post(String title, Date publicationDate, String excerpt, int type) {
		super();
		_title = title;
		_publicationDate = publicationDate;
		_excerpt = excerpt;
		_type = type;
	}
	
	public int getTypeRessource() {
		switch(_type) {
			case TYPE_GWT: return R.drawable.type_gwt;
			case TYPE_GENERAL: return R.drawable.type_general;
			case TYPE_SMARTY: return R.drawable.type_smarty;
			default: return R.drawable.type_nothing;
		}
	}

	public String getTitle() {
		return _title;
	}
	public void setTitle(String title) {
		_title = title;
	}
	public Date getPublicationDate() {
		return _publicationDate;
	}
	public void setPublicationDate(Date publicationDate) {
		_publicationDate = publicationDate;
	}
	public String getExcerpt() {
		return _excerpt;
	}
	public int getType() {
		return _type;
	}
	public void setExcerpt(String excerpt) {
		_excerpt = excerpt;
	}
	public void setType(int type) {
		_type = type;
	}
	public String getLink() {
		return _link;
	}
	public void setLink(String link) {
		_link = link;
	}
}